# -*- coding: utf-8 -*-
# @Time    : 2024/12/18 21:24
# @Author  : xiangbo
# @Email   : xiangbo@163.com
# @File    : shell.py
# @Software: PyCharm
"""
封装shell命令
"""
import subprocess


class Shell:
    @staticmethod
    def execute(cmd):
        output, errors = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
                                          stderr=subprocess.PIPE).communicate()
        out_msg = output.decode("gbk")
        return out_msg
